package com.tsd.jxc.stock.entity;

import com.tsd.jxc.stock.vo.JxcStockGoodsVo;
import io.swagger.annotations.ApiModel;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 商品库存表扩展
 *
 * @author Hillpool
 * @date 2022/07/29 15:06:33
 */
@ApiModel(description = "商品库存表扩展")
public class JxcStockGoodsExt extends JxcStockGoods implements Serializable {

    private BigDecimal avg_in_price;
    private String goods_code;
    private String goods_name;
    private String goods_model;
    private String goods_spec;
    private String goods_pic_file_sid;
    private String base_unit;
    private BigDecimal base_buy_price;
    private BigDecimal base_sale_price;
    private String category_name;
    private String warehouse_name;
    private String old_qty;
    private String check_qty;
    private List<String> goods_list;
    private List<String> sid_list;

    public BigDecimal getAvg_in_price() {
        return avg_in_price;
    }

    public void setAvg_in_price(BigDecimal avg_in_price) {
        this.avg_in_price = avg_in_price;
    }

    public String getGoods_code() {
        return goods_code;
    }

    public void setGoods_code(String goods_code) {
        this.goods_code = goods_code;
    }

    public String getGoods_name() {
        return goods_name;
    }

    public void setGoods_name(String goods_name) {
        this.goods_name = goods_name;
    }

    public String getGoods_model() {
        return goods_model;
    }

    public void setGoods_model(String goods_model) {
        this.goods_model = goods_model;
    }

    public String getGoods_spec() {
        return goods_spec;
    }

    public void setGoods_spec(String goods_spec) {
        this.goods_spec = goods_spec;
    }

    public String getGoods_pic_file_sid() {
        return goods_pic_file_sid;
    }

    public void setGoods_pic_file_sid(String goods_pic_file_sid) {
        this.goods_pic_file_sid = goods_pic_file_sid;
    }

    public String getBase_unit() {
        return base_unit;
    }

    public void setBase_unit(String base_unit) {
        this.base_unit = base_unit;
    }

    public BigDecimal getBase_buy_price() {
        return base_buy_price;
    }

    public void setBase_buy_price(BigDecimal base_buy_price) {
        this.base_buy_price = base_buy_price;
    }

    public BigDecimal getBase_sale_price() {
        return base_sale_price;
    }

    public void setBase_sale_price(BigDecimal base_sale_price) {
        this.base_sale_price = base_sale_price;
    }

    public String getCategory_name() {
        return category_name;
    }

    public void setCategory_name(String category_name) {
        this.category_name = category_name;
    }

    public String getWarehouse_name() {
        return warehouse_name;
    }

    public void setWarehouse_name(String warehouse_name) {
        this.warehouse_name = warehouse_name;
    }

    public String getOld_qty() {
        return old_qty;
    }

    public void setOld_qty(String old_qty) {
        this.old_qty = old_qty;
    }

    public String getCheck_qty() {
        return check_qty;
    }

    public void setCheck_qty(String check_qty) {
        this.check_qty = check_qty;
    }

    public List<String> getGoods_list() {
        return goods_list;
    }

    public void setGoods_list(List<String> goods_list) {
        this.goods_list = goods_list;
    }

    public List<String> getSid_list() {
        return sid_list;
    }

    public void setSid_list(List<String> sid_list) {
        this.sid_list = sid_list;
    }

    public JxcStockGoodsVo convert2GoodsVo() {
        JxcStockGoodsVo goodsVo = new JxcStockGoodsVo();
        goodsVo.setSid(this.getSid());
        goodsVo.setCategory_name(this.getCategory_name());
        goodsVo.setGoods_code(this.getGoods_code());
        goodsVo.setGoods_name(this.getGoods_name());
        goodsVo.setGoods_spec(this.getGoods_spec());
        goodsVo.setGoods_model(this.getGoods_model());
        goodsVo.setWarehouse_name(this.getWarehouse_name());
        goodsVo.setBase_buy_price(this.getBase_buy_price());
        goodsVo.setStock_sum_qty(this.getStock_sum_qty());
        goodsVo.setBase_unit(this.getBase_unit());
        goodsVo.setAvg_cost(this.getAvg_cost());
        goodsVo.setInit_qty(this.getInit_qty());
        goodsVo.setInit_amount(this.getInit_amount());
        goodsVo.setIndex("ROW()-1");
        goodsVo.setFormula_avg_cost("formula:IF(ISERROR(L$currRow$/K$currRow$),0,L$currRow$/K$currRow$)");
        return goodsVo;
    }
}
